﻿using Abp.Application.Services;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using App.Goods.Dto;
using App.BaseObject;

namespace App.Goods
{
    public interface IGoodsAppService : IApplicationService
    {
        /// <summary>
        /// 创建
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task CreateGoods(ProductDto dto);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="id"></param>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task UpdateGoods(int id, ProductDto dto);

        /// <summary>
        /// 保存配置
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task SaveBrands(BulkDto<BrandDto> dto);

        /// <summary>
        /// 获取商品信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<Product> GetGoods(int id);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="idList"></param>
        /// <returns></returns>
        Task DeleteAsync(int[] idList);

        #region GoodsCategory
        /// <summary>
        /// 获取分类
        /// </summary>
        /// <returns></returns>
        Task<List<ProductCategory>> GetCategorys(Expression<Func<ProductCategory, bool>> predicate = null);

        /// <summary>
        /// 创建分类
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task CreateCategory(CategoryDto dto);

        /// <summary>
        /// 修改分类
        /// </summary>
        /// <param name="id"></param>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task UpdateCategory(int id, CategoryDto dto);

        /// <summary>
        /// 删除分类
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task DeleteCategoryAsync(int id);
        #endregion
    }
}
